import React,{useEffect} from 'react'
import { useDispatch,useSelector } from 'react-redux'
import * as api from '../../api/index'
import { Swiper, Image } from 'react-vant';

function Shou() {
  
  const dispatch = useDispatch();
  useEffect(()=>{
    dispatch(api.getSwiper());
  },[dispatch])

  const dates =useSelector(state =>{
    return state.reducer.swiper
  })
  console.log(dates)
  return (
    <div>
        <Swiper autoplay={true}>
          {dates.map((image,index) => (
            <Swiper.Item key={index}>
              <Image lazyload src={image} />
            </Swiper.Item>
          ))}
        </Swiper>
        {/* 轮播部分 */}
    </div>
  )
}

export default Shou